﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using Mobile.MainService;

namespace Mobile.Models
{
    public class Party
    {
        Service sv = new Service();

        [Required]
        [Key]
        public string PartyID { get; set; }

        public string Description { get; set; }

        public DateTime EndTime { get; set; }

        public Queue queue { get; set; }

        public List<Song> allSongs
        {
            get
            {
                List<Song> Allsongs = new List<Song>();
                foreach (SongData sd in  sv.GetAllSongs(PartyID).ToList())
                {
                    Allsongs.Add(new Song { ID = sd.SongID, Title = sd.Title, Artist = sd.Artist, UpVotes = 0});
                }
                return Allsongs;
            }
            set
            {
                allSongs = value;
            }
        }

     }

}